package com.itheima.service.impl;

import com.itheima.mapper.EmployeeMapper;
import com.itheima.model.Employee;
import com.itheima.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wuli
 * @create 2021-10-26 23:18
 */
@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;


    @Override
    public Employee getEmployee(Employee employee) {
        return employeeMapper.selectOne(employee);
    }

    @Override
    public Employee selectEmployeeById(int id) {
        return employeeMapper.selectByPrimaryKey(id);
    }

    @Override
    public void saveEmployee(Employee employee) {
        employeeMapper.insert(employee);
    }
}
